<script setup>
import { ref } from 'vue'
import AudioRecorder from './components/AudioRecorder.vue'

const activeTab = ref('audioRecorder')
</script>

<template>
  <div id="app">
    <header>
      <h1>SenseVoice 语音识别</h1>
      <nav class="nav-tabs">
        <div class="nav-tab" :class="{ 'active': activeTab === 'audioRecorder' }" @click="activeTab = 'audioRecorder'">
          语音识别
        </div>
      </nav>
    </header>
    <main>
      <AudioRecorder v-if="activeTab === 'audioRecorder'" />
    </main>
  </div>
</template>

<style>
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  color: #2c3e50;
  max-width: 800px;
  margin: 0 auto;
  padding: 20px;
}

header {
  text-align: center;
  margin-bottom: 30px;
}

h1 {
  margin-bottom: 20px;
}

.nav-tabs {
  display: flex;
  justify-content: center;
  border-bottom: 1px solid #ddd;
  margin-bottom: 20px;
}

.nav-tab {
  padding: 10px 20px;
  cursor: pointer;
  border-radius: 4px 4px 0 0;
  margin: 0 5px;
  transition: background-color 0.3s;
}

.nav-tab:hover {
  background-color: #f5f5f5;
}

.nav-tab.active {
  background-color: #4CAF50;
  color: white;
  border-bottom: 2px solid #4CAF50;
}

main {
  background-color: #ffffff;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}
</style>
